package com.itfreer.special.index;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.itfreer.form.api.BaseDao;
import com.itfreer.form.api.DictionaryServiceImp;
import com.itfreer.form.api.dictionary.DictionaryEntity;

/**
 * 定义目录实现类
 */
@Component
@Service(interfaceClass = IndexClumnService.class, path = "indexclumn")
public class IndexClumnServiceImp extends DictionaryServiceImp<IndexClumnEntity> implements IndexClumnService {

	@Autowired
	private IndexClumnDao dao;

	@Override
	protected BaseDao<IndexClumnEntity> getDao() {
		return dao;
	}

	@Override
	public String getDictionaryName() {
		return "indexclummn";
	}

	@Override
	protected DictionaryEntity convert(IndexClumnEntity entity) {
		DictionaryEntity toEntity = new DictionaryEntity();
		BeanUtils.copyProperties(entity, toEntity);
		return toEntity;
	}

	@Override
	protected String getDictionaryFields() {
		return "*";
	}

	/**
	 * 是否是树表
	 */
	protected boolean isTree() {
		return true;
	}

	/**
	 * 树的PID字段名
	 */
	protected String getTreePIDFieldName() {
		return "pid";
	}
}
